//
//  WCUserInfo.m
//  WeChat
//
//  Created by lin on 15/7/16.
//  Copyright (c) 2015年 lin. All rights reserved.
//

#import "WCUserInfo.h"
#define LoginStatusKey @"loginStatus"
#define UserKey @"usr"
#define LoginPWDKey @"pwd"
@implementation WCUserInfo
singleton_implementation(WCUserInfo);

-(void)saveUserInfoToSandbox{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setObject:self.usr forKey:UserKey];
    [defaults setBool:self.loginStatus forKey:LoginStatusKey];
    [defaults setObject:self.pwd forKey:LoginPWDKey];
    [defaults synchronize];
}

-(void)loadUserInfoFromSandbox{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    self.usr = [defaults objectForKey:UserKey];
    self.loginStatus = [defaults boolForKey:LoginStatusKey];
    self.pwd = [defaults objectForKey:LoginPWDKey];
    [defaults synchronize];
}

@end
